module instr_rom (
	input [9:0] addr,
	output [31:0] inst
);
	reg [31:0] memory[1023:0];

	assign inst = memory[addr];

	initial begin
        // Example program:
        // start:
        memory[0] = 32'h00500113; // addi $2, $0, 5
        memory[1] = 32'h00c00193; // addi $3, $0, 12
        memory[2] = 32'hff718393; // addi $7, $3, -9
        memory[3] = 32'h0023e233; // or $4, $7, $2
        memory[4] = 32'h00420293; // addi $5, $4, 4
        memory[5] = 32'h005380e3; // beq $5, $7, end        
        memory[6] = 32'h0041a233; // slt, $4,$3,$4       
        memory[7] = 32'h00400163; // beq $4, $0, around          
        memory[8] = 32'h00500393; // add $7, $3, $2
        
        // around: 
        memory[9] = 32'h0023a233;  // slt, $4,$7,$2
        memory[10] = 32'h0471a223; // sw,$7, 68($3)
        memory[11] = 32'h05002103; // lw, $2, 80($0)
        memory[12] = 32'h0020046f; // jal $8, end
        memory[13] = 32'h0024a233; // sltu, $2,$3,$4

        // end:
        memory[14] = 32'h0000f137; // lui, $2, 15 =>0000f000
        memory[15] = 32'h04202a23; // sw, $2, 54($0)
        
    end
	
endmodule